# test.py
tx = {
    'duration_sec': 12.5,
    'rows_affected': 48320,
    'lock_time_sec': 0.002,
    'sql': "UPDATE orders SET status = 'shipped' WHERE created_at < '2023-01-01';"
}

# 现在你可以使用 tx 了
fingerprint = f"long_tx_{int(tx['duration_sec']/10)}s_rows{tx['rows_affected']}"
print(fingerprint)  # 输出: long_tx_1s_rows48320